package com.seniorgradefive.product.controlleradvice;
import com.seniorgradefive.common.core.domain.Result;
import com.seniorgradefive.product.excption.ProductException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import javax.print.PrintException;

/**
 * @Author：作者姓名
 * @Package：com.seniorgradefive.product.controlleradvice
 * @Project：SeniorGradeFive-Cloud-01
 * @name：ExceptionResult
 * @Date：2024/5/9 15:16
 */
@RestControllerAdvice
public class ExceptionResult {

    @ExceptionHandler(value = PrintException.class)
    public Result error(ProductException e){
        return Result.error(e.getMessage());
    }
}
